package com.netease.financial.domain.interactor;

import com.netease.financial.domain.Factory;
import com.netease.financial.domain.executor.PostExecutionThread;
import com.netease.financial.domain.executor.ThreadExecutor;
import com.netease.financial.domain.repository.NfsRepository;

import rx.Observable;

/**
 * Created by hzwuyufeng on 1/20/16.
 */
public class Logout extends UseCase {

    private final NfsRepository mNfsRepository;
    private Factory<String> mAccessToken;
    private final String mAppSecret;

    public Logout(Factory<String> accessToken, String appSecret,
                  NfsRepository nfsRepository, ThreadExecutor threadExecutor, PostExecutionThread postExecutionThread) {
        super(threadExecutor, postExecutionThread);
        mAccessToken = accessToken;
        mAppSecret = appSecret;
        mNfsRepository = nfsRepository;
    }

    @Override
    protected Observable buildUseCaseObservable() {
        return mNfsRepository.logout(mAccessToken.get(), mAppSecret);
    }

}
